package cn.aj.exm.feign;

import cn.aj.exm.domain.UserMovie;
import cn.aj.exm.fallback.UserMovieServiceFallbackFactory;
import cn.aj.exm.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@FeignClient(name = "service-movie", contextId = "userMovieService", path = "userMovie", fallbackFactory = UserMovieServiceFallbackFactory.class)
public interface UserMovieService {

    @RequestMapping(value = "/userMovieLoadTicket{movieId}/{userId}",method = RequestMethod.GET)
    JsonResult userMovieLoadTicket(@PathVariable("movieId") Long movieId, @PathVariable("userId")Long userId);

    @RequestMapping(value="/save",method= RequestMethod.POST)
    JsonResult saveOrUpdate(@RequestBody UserMovie userMovie);
}
